fileclick=function(){
	let t=document.getElementById("file");
	t.click();
}

getValue=function()
{
	let x=document.getElementById("file").value;
	if(x=="")
	{
	return false;
	}
	return true;
}
window.onfocus = function () {
	setTimeout(() =>{
		if(document.getElementById("file")!=null)
		if(getValue())
		{
				document.getElementById("mysubmit").click();
				let x=document.getElementById("file");
				x.value="";
		}
	}, 1000);
};
loadin=function(){
	let s1=document.getElementById('onein');
	let s2=document.getElementById('towin');
	let p1=document.getElementById('position1');
	let memoy=document.getElementById('xzbz');
	setin4('0','xzbz','/salary/findBysStatus');
	setin2('0','position1','/positions/findType');
	setin('0','onein',"/institution/findByParent");
	s1.onchange=function(){
		setin(s1.value,'towin',"/institution/findByParent");
	}
	s2.onchange=function(){
		setin(s2.value,'thirdin',"/institution/findByParent");
	}
	p1.onchange=function(){
		setin3(p1.value,'position2','/positions/findByType');
	}
}
setin=function(iID,id,url){
	let select=document.getElementById(id).options;
	let len=select.length-1;
	//console.log(select);
	for(let i=0;i<len;i++){
		select[1].remove();
	}
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){	
				let t=JSON.parse(xml.responseText);
				for(let i=0;i<t.data.length;i++){
					insertin(id,t.data[i].iName,t.data[i].iID);
				}
		}
	}
	xml.open("post",url,true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send('iParent='+iID);
}
setin2=function(iID,id,url){
	let select=document.getElementById(id).options;
	let len=select.length-1;
	//console.log(select);
	for(let i=0;i<len;i++){
		select[1].remove();
	}
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){	
				let t=JSON.parse(xml.responseText);
				for(let i=0;i<t.data.length;i++){
					insertin(id,t.data[i],t.data[i]);
				}
		}
	}
	xml.open("post",url,true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send();
}
setin3=function(iID,id,url){
	let select=document.getElementById(id).options;
	let len=select.length-1;
	//console.log(select);
	for(let i=0;i<len;i++){
		select[1].remove();
	}
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){	
				let t=JSON.parse(xml.responseText);
				for(let i=0;i<t.data.length;i++){
					insertin(id,t.data[i].pName,t.data[i].pName);
				}
		}
	}
	xml.open("post",url,true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send('pCategory='+iID);
}
setin4=function(iID,id,url){
	let select=document.getElementById(id);
	if(select==null)
	return;
	select=document.getElementById(id).options;
	let len=select.length-1;
	//console.log(select);
	for(let i=0;i<len;i++){
		select[1].remove();
	}
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){	
				let t=JSON.parse(xml.responseText);
				for(let i=0;i<t.data.length;i++){
					insertin(id,t.data[i].sName,t.data[i].sID);
				}
		}
	}
	xml.open("post",url,true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send('sStatus=1');
}
insertin=function(id,name,iID){
	let op=document.createElement("option")
	op.innerText=name;
	op.value=iID;
	let select=document.getElementById(id);
	select.appendChild(op);
}
tjclick=function(url){
		let input1;
		let input2;
		let input3;
		let input4;
		let input5;
		let input6;
	if(url=="/employee/insert"||url=="/employee/update")
	{
		 input1=document.getElementById('onein');
		 input2=document.getElementById('towin');
		 input3=document.getElementById('thirdin');
		 input4=document.getElementById('position1');
		 input5=document.getElementById('position2');
		 input6=document.getElementById('position3');
	}else{
	 input1=document.getElementById('ycipnut1');
	 input2=document.getElementById('ycipnut2');
	 input3=document.getElementById('ycipnut3');
	 input4=document.getElementById('ycipnut4');
	 input5=document.getElementById('ycipnut5');
	 input6=document.getElementById('ycipnut6');
	}
	
	let input7=document.getElementById('name');
	let input8=document.getElementById('sex');
	let input9=document.getElementById('yx');
	let input10=document.getElementById('dh');
	let input11=document.getElementById('sj');
	let input12=document.getElementById('QQ');
	let input13=document.getElementById('place');
	let input14=document.getElementById('bplace');
	let input15=document.getElementById('yb');
	let input16=document.getElementById('sfz');
	let input17=document.getElementById('shbzhm');
	let input18=document.getElementById('sr').querySelector('input');
	let input19=document.getElementById('nl');
	let input20=document.getElementById('gj');
	let input21=document.getElementById('mz');
	let input22=document.getElementById('zjxy');
	let input23=document.getElementById('zzmm');
	let input24=document.getElementById('xl');
	let input25=document.getElementById('xlzy');
	let input26=document.getElementById('tc');
	let input27=document.getElementById('ah');
	let input28=document.getElementById('xzbz');
	let input29=document.getElementById('khh');
	let input30=document.getElementById('yhkzh');
	let input31=document.getElementById('grll');
	let input32=document.getElementById('homegx');
	let input33=document.getElementById('bz');
	let input34=document.getElementById('djrq').querySelector('input');
	let input35=document.getElementById('djr');
	let input36=document.getElementById('ygtx');
	let id=getfhid1();
	let status=0;
	if(url=="/employee/insert")
		id=0;
	if(url=="/employee/update")
		status=1;
	let xml;
	if (window.XMLHttpRequest)
	{
	    //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
	    xml=new XMLHttpRequest();
	}
	else
	{
	    // IE6, IE5 浏览器执行代码
	    xml=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xml.onreadystatechange=function(){
		if(xml.readyState==4&&xml.status==200){
			    let aaa=JSON.parse(xml.responseText);
				if(aaa.status==200)
				{
					alert("成功");

					if(url=="/employee/update"){
						let mya=document.createElement('a');
						mya.href="employeereview.html";
						mya.click();
					}
				}

		}
	}
	xml.open("post",url,true);
	xml.setRequestHeader('content-type','application/x-www-form-urlencoded');
	xml.send(
	'e_L1InstID='+input1.value+'&e_L2InstID='+input2.value+'&e_L3InstID='+input3.value+
	'&ePositionCategory='+input4.value+'&ePositionName='+input5.value+'&eJobTitle='+input6.value+
	'&eName='+input7.value+'&eGender='+input8.value+'&eEmail='+input9.value+
	'&eFixedPhone='+input10.value+'&eCellPhone='+input11.value+'&eQQ='+input12.value+
	'&eAddress='+input13.value+'&eBirthplace='+input14.value+'&ePostcode='+input15.value+
	'&eIDcard='+input16.value+'&eSSC='+input17.value+'&eBirthday='+input18.value+
	'&eAge='+input19.value+'&eCountry='+input20.value+'&eEthnic='+input21.value+
	'&eReligion='+input22.value+'&ePolitical='+input23.value+'&eEducation='+input24.value+
	'&eMajor='+input25.value+'&eSpecically='+input26.value+'&eHobby='+input27.value+
	'&eSalary='+input28.value+'&eBankName='+input29.value+'&eBankAccount='+input30.value+
	'&eResume='+input31.innerText+'&eFamily='+input32.innerText+'&eRemarks='+input33.value+
	'&eAvatar='+input36.src+'&eID='+id+'&eStatus='+status);
}
let getfhid1=function(){
	let id=decodeURI(window.location .href);
    let aa=id.indexOf('=');
    if (aa>-1){
    id=id.substring(aa+1);
    }
    return id;
}